package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.CleaningUpDataService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

public class ClearUpDataJob {
    //注入CleaningUpDataService
    @Reference
    private CleaningUpDataService cleaningUpDataService;

    //定时清理预约设置数据
    public void clearUpData() {

        //远程调用Service方法
        try {
            cleaningUpDataService.clearUpData();
            System.out.println("已经删除过去无用历史预约数据");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("删除失败");
        }
    }
}
